function MovingFrame() {

	/**
	 * Header mousedown point - remembers position of mouse pointer during mousedown
	 * event on window header dom object
	 * 
	 * @private
	 * @property  headerMouseDownPoint
	 * @type      {MessCoordinate}
	 * @default   null
	 */
	this.mouseDownPoint = null;
	
	/**
	 * Window moving area. 
	 * 
	 * @private
	 * @property  movingArea
	 * @type      {MessCoordinate}
	 * @default   null
	 */
	this.movingArea = null;
	
	this.cssPrefix = "Window";
	this.FRAME_CSS_SUFFIX = "MovingFrame";
}
MovingFrame.prototype = new MessUIElement();


	/**
	* Builds floating window object. Performs any necessary initialization
	*
	* @public
	* @method  build
	*/
	MovingFrame.prototype.build = function() {

        // initialize control
        this.initControl();
             
        // build dom
        this.buildDOMObject();  
        
        // set moving area size
        this.initMovingArea();  	
	};
	
	/**
	* Builds dom object representation
	*
	* @private
	* @method  buildDOMObject
	*/
	MovingFrame.prototype.buildDOMObject = function() {
	
		// update theme
		if (this.getTheme() === null) {
			this.setTheme("Default");
		}
		
		// build frame
		var frame = this.buildWindowFrame();
		
		// save dom object, inherit both dimensions and position from parent
		this.setDomObject(frame, true, true);
        // init z-index
        this.setZIndex(this.getRootPanel().getFloatingControls().size());
        // init position & dimension
        this.setLeft(this.parent.getLeft());
		this.setTop(this.parent.getTop());
        this.setWidth(this.parent.getFloatingWidth());
        this.setHeight(this.parent.getFloatingHeight());
    };
	
	/**
	* Builds window frame dom
	*
	* @private
	* @method  buildWindowFrame
	* @return  {DOM} frame dom object
	*/
	MovingFrame.prototype.buildWindowFrame = function() {
		
		var frame = DIV();
			frame.id = this.id;
			frame.className = this.getCssPrefix() + this.FRAME_CSS_SUFFIX;

		return frame;
	};
	
	/**
	 * Rememers mouse position over header during window activation - start of movement
	 * 
	 * @private
	 * @method  initHeaderMouseDownPoint
	 */
	MovingFrame.prototype.initMouseDownPoint = function(oEvent) {
	 		
		// initialize header mousedown point coordinate, used during window movement
		this.mouseDownPoint = new MessCoordinate(oEvent.clientX, oEvent.clientY);
		this.mouseDownPoint.setDeltaX(oEvent.clientX - this.parent.getLeft());	
		this.mouseDownPoint.setDeltaY(oEvent.clientY - this.parent.getTop());
	}
	
	/**
	 * Determines size of floating window moving area
	 * 
	 * @private
	 * @method  initMovingAreaSize
	 */ 
	MovingFrame.prototype.initMovingArea = function() {
		
		this.movingArea = this.getRootPanel().getMovingArea();
		this.movingArea.setDeltaX(this.movingArea.getX() + this.movingArea.getDeltaX() - this.getWidth());
		this.movingArea.setDeltaY(this.movingArea.getY() + this.movingArea.getDeltaY() - this.getHeight());
	};
	
	/**
	 * Event handler for event dispatched from root panel to this control.
	 * 
	 * @public
	 * @method  handleEvent
	 * @param   {Event} event   event to handle
	 */
	MovingFrame.prototype.handleEvent = function(oEvent) {
		
		if (oEvent.type === eventUtil.MOUSE_MOVE) {
		// handle mousemove	
			return this.move(oEvent);	
		}	
		
		if (oEvent.type === eventUtil.MOUSE_UP) {
		// handle mouseup
			return this.finishMoving(oEvent);
		}
	};
	
	/**
	* Moves frame control - floating window moving process in progress
	*
	* @public
	* @method  deactivate
	*/
	MovingFrame.prototype.move = function(oEvent) {
	
		var left = oEvent.clientX - this.mouseDownPoint.getDeltaX();
		var top = oEvent.clientY - this.mouseDownPoint.getDeltaY();
		
		// left position
		//
		if (left >= this.movingArea.getX() && left <= (this.movingArea.getX() + this.movingArea.getDeltaX())) {  
			this.setLeft(left);	
		}
		else if (left < this.movingArea.getX()) {
			this.setLeft(this.movingArea.getX());
		}
		else if (left > this.movingArea.getX() + this.movingArea.getDeltaX()) {
			this.setLeft(this.movingArea.getX() + this.movingArea.getDeltaX());
		}
		
		// top position
		//
		if (top >= this.movingArea.getY() && top <= (this.movingArea.getY() + this.movingArea.getDeltaY())) {
			this.setTop(top);
		}	
		else if (top < this.movingArea.getY()) {
			this.setTop(this.movingArea.getY());
		}
		else if (top > this.movingArea.getY() + this.movingArea.getDeltaY()) {
			this.setTop(this.movingArea.getY() + this.movingArea.getDeltaY() - 1);
		}
	}
	
	/**
	 * Finishes window (floating) movement
	 * 
	 * @public
	 * @method  finishMoving
	 */
	MovingFrame.prototype.finishMoving = function(oEvent) {
		
		this.move(oEvent);
		this.parent.finishMoving(this, this.getLeft(), this.getTop());
	};
	